home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
bash1135
/
diffs
< prev
next >
Wrap
Text File
|
1994-02-20
|
31KB
|
1,047 lines
diff -u2r orig/builtins/alias.def ./builtins/alias.def
--- orig/builtins/alias.def Tue Aug 31 22:11:24 1993
+++ ./builtins/alias.def Fri Feb 11 23:06:16 1994
@@ -58,4 +58,7 @@
alias_list = all_aliases ();
+ if (!alias_list)
+ return (EXECUTION_FAILURE);
+
for (i = 0; alias_list[i]; i++)
print_alias (alias_list[i]);
diff -u2r orig/builtins/cd.def ./builtins/cd.def
--- orig/builtins/cd.def Tue Aug 31 19:52:32 1993
+++ ./builtins/cd.def Sun Nov 21 21:07:56 1993
@@ -249,12 +249,12 @@
directory. With no arguments, exchanges the top two directories.
-+n Rotates the stack so that the Nth directory (counting
- from the left of the list shown by `dirs') is at the top.
++n Rotates the stack so that the Nth directory (counting
+ from the left of the list shown by `dirs') is at the top.
--n Rotates the stack so that the Nth directory (counting
- from the right) is at the top.
+-n Rotates the stack so that the Nth directory (counting
+ from the right) is at the top.
-dir adds DIR to the directory stack at the top, making it the
- new current working directory.
+dir adds DIR to the directory stack at the top, making it the
+ new current working directory.
You can see the directory stack with the `dirs' command.
@@ -451,11 +451,11 @@
top directory.
-+n removes the Nth entry counting from the left of the list
- shown by `dirs', starting with zero. For example: `popd +0'
- removes the first directory, `popd +1' the second.
-
--n removes the Nth entry counting from the right of the list
- shown by `dirs', starting with zero. For example: `popd -0'
- removes the last directory, `popd -1' the next to last.
++n removes the Nth entry counting from the left of the list
+ shown by `dirs', starting with zero. For example: `popd +0'
+ removes the first directory, `popd +1' the second.
+
+-n removes the Nth entry counting from the right of the list
+ shown by `dirs', starting with zero. For example: `popd -0'
+ removes the last directory, `popd -1' the next to last.
You can see the directory stack with the `dirs' command.
diff -u2r orig/builtins/echo.def ./builtins/echo.def
--- orig/builtins/echo.def Tue Aug 31 19:52:32 1993
+++ ./builtins/echo.def Sun Nov 21 21:02:32 1993
@@ -31,14 +31,14 @@
suppressed. If the -e option is given, interpretation of the
following backslash-escaped characters is turned on:
- \a alert (bell)
- \b backspace
- \c suppress trailing newline
- \f form feed
- \n new line
- \r carriage return
- \t horizontal tab
- \v vertical tab
- \\ backslash
- \num the character whose ASCII code is NUM (octal).
+ \a alert (bell)
+ \b backspace
+ \c suppress trailing newline
+ \f form feed
+ \n new line
+ \r carriage return
+ \t horizontal tab
+ \v vertical tab
+ \\ backslash
+ \num the character whose ASCII code is NUM (octal).
You can explicitly turn off the interpretation of the above characters
diff -u2r orig/builtins/exec.def ./builtins/exec.def
--- orig/builtins/exec.def Tue Aug 31 19:52:32 1993
+++ ./builtins/exec.def Wed Nov 17 23:32:40 1993
@@ -48,4 +48,7 @@
extern char *find_user_command ();
+#ifdef atarist
+extern char *find_suffixed_file ();
+#endif
int
@@ -67,4 +70,5 @@
/* Otherwise, execve the new command with args. */
char *command, **args;
+ char *p;
int dash_name = 0;
@@ -85,5 +89,9 @@
the search path. */
if (absolute_program (args[0]))
- command = args[0];
+#ifdef atarist
+ command = find_suffixed_file (args[0]);
+#else
+ command = savestring (args[0]);
+#endif
else
command = find_user_command (args[0]);
@@ -95,5 +103,7 @@
}
- command = full_pathname (command);
+ p = full_pathname (command);
+ free (command);
+ command = p;
/* If the user wants this to look like a login shell, then
prepend a `-' onto the first argument (argv[0]). */
diff -u2r orig/builtins/let.def ./builtins/let.def
--- orig/builtins/let.def Tue Aug 31 19:52:32 1993
+++ ./builtins/let.def Sun Nov 21 21:02:04 1993
@@ -30,11 +30,11 @@
The levels are listed in order of decreasing precedence.
- - unary minus
- ! logical NOT
- * / % multiplication, division, remainder
- + - addition, subtraction
- <= >= < > comparison
- == != equality inequality
- = assignment
+ - unary minus
+ ! logical NOT
+ * / % multiplication, division, remainder
+ + - addition, subtraction
+ <= >= < > comparison
+ == != equality inequality
+ = assignment
Shell variables are allowed as operands. The name of the variable
diff -u2r orig/builtins/reserved.def ./builtins/reserved.def
--- orig/builtins/reserved.def Tue Aug 31 19:52:32 1993
+++ ./builtins/reserved.def Sun Nov 21 21:01:24 1993
@@ -85,24 +85,24 @@
BASH_VERSION The version numbers of this Bash.
CDPATH A colon separated list of directories to search
- when the argument to `cd' is not found in the current
- directory.
+ when the argument to `cd' is not found in the current
+ directory.
#if defined (HISTORY)
HISTFILE The name of the file where your command history is stored.
HISTFILESIZE The maximum number of lines this file can contain.
HISTSIZE The maximum number of history lines that a running
- shell can access.
+ shell can access.
#endif /* HISTORY */
HOME The complete pathname to your login directory.
HOSTTYPE The type of CPU and OS this version of Bash is running
- under.
+ under.
PATH A colon separated list of directories to search when
- looking for commands.
+ looking for commands.
PROMPT_COMMAND A command to be executed before the printing of each
- primary prompt.
+ primary prompt.
PS1 The primary prompt string.
TERM The name of the current terminal type (/etc/termcap).
auto_resume Non-null means a command word appearing on a line by
- itself is first looked for in the list of currently
- stopped jobs. If found there, that job is foregrounded.
+ itself is first looked for in the list of currently
+ stopped jobs. If found there, that job is foregrounded.
#if defined (HISTORY)
command_oriented_history
@@ -121,29 +121,29 @@
# if defined (BANG_HISTORY)
histchars Characters controlling history expansion and quick
- substitution. The first character is the history
- substitution character, usually `!'. The second is
- the `quick substition' character, usually `^'.
+ substitution. The first character is the history
+ substitution character, usually `!'. The second is
+ the `quick substition' character, usually `^'.
# endif /* BANG_HISTORY */
history_control Set to a value of "ignorespace", it means don't enter
- lines which begin with a SPC on the history list. Set
- to a value of "ignoredups", it means don't enter lines
- which match the last entered line. Unset, or any
- other value than those above mean to save all lines
- on the history list.
+ lines which begin with a SPC on the history list. Set
+ to a value of "ignoredups", it means don't enter lines
+ which match the last entered line. Unset, or any
+ other value than those above mean to save all lines
+ on the history list.
#endif /* HISTORY */
hostname_completion_file
- Contains the name of a file in the same format as
- `/etc/hosts' that should be read when Bash needs to
- complete a hostname.
+ Contains the name of a file in the same format as
+ `/etc/hosts' that should be read when Bash needs to
+ complete a hostname.
ignoreeof Controls the action of the shell on receipt of an EOF
- character as the sole input. If set, then the value
- of it is the number of EOF characters that can be seen
- in a row as sole input characters before the shell
- will exit (default 10). When unset, EOF signifies the
- end of input.
+ character as the sole input. If set, then the value
+ of it is the number of EOF characters that can be seen
+ in a row as sole input characters before the shell
+ will exit (default 10). When unset, EOF signifies the
+ end of input.
no_exit_on_failed_exec
- If this variable exists, the shell will not exit in
- the case that it couldn't execute the file specified
- in the `exec' command.
+ If this variable exists, the shell will not exit in
+ the case that it couldn't execute the file specified
+ in the `exec' command.
#if defined (JOB_CONTROL)
notify notify of job termination immediately.
diff -u2r orig/builtins/set.def ./builtins/set.def
--- orig/builtins/set.def Tue Aug 31 19:52:32 1993
+++ ./builtins/set.def Sat Nov 20 20:59:28 1993
@@ -63,5 +63,5 @@
notify save as -b
nounset same as -u
- privileged same as -p
+ privileged same as -p
verbose same as -v
#if defined (READLINE)
@@ -72,5 +72,5 @@
Disables processing of the $ENV file and importing of shell
functions. Turning this option off causes the effective uid and
- gid to be set to the real uid and gid.
+ gid to be set to the real uid and gid.
-t Exit after reading and executing one command.
-u Treat unset variables as an error when substituting.
diff -u2r orig/builtins/ulimit.def ./builtins/ulimit.def
--- orig/builtins/ulimit.def Tue Aug 31 19:52:34 1993
+++ ./builtins/ulimit.def Sun Nov 21 20:58:36 1993
@@ -29,17 +29,17 @@
option is given, it is interpreted as follows:
- -S use the `soft' resource limit
- -H use the `hard' resource limit
- -a all current limits are reported
- -c the maximum size of core files created
- -d the maximum size of a process's data segment
- -m the maximum resident set size
- -s the maximum stack size
- -t the maximum amount of cpu time in seconds
- -f the maximum size of files created by the shell
- -p the pipe buffer size
- -n the maximum number of open file descriptors
+ -S use the `soft' resource limit
+ -H use the `hard' resource limit
+ -a all current limits are reported
+ -c the maximum size of core files created
+ -d the maximum size of a process's data segment
+ -m the maximum resident set size
+ -s the maximum stack size
+ -t the maximum amount of cpu time in seconds
+ -f the maximum size of files created by the shell
+ -p the pipe buffer size
+ -n the maximum number of open file descriptors
-u the maximum number of user processes
- -v the size of virtual memory
+ -v the size of virtual memory
If LIMIT is given, it is the new value of the specified resource.
diff -u2r orig/config.h ./config.h
--- orig/config.h Tue Aug 31 19:52:34 1993
+++ ./config.h Sat Dec 18 16:04:40 1993
@@ -127,5 +127,5 @@
Posix compliant behaviour by setting the environment variable
POSIXLY_CORRECT. */
-#define ALLOW_RIGID_POSIX_COMPLIANCE
+/* #define ALLOW_RIGID_POSIX_COMPLIANCE */
/* Define RESTRICTED_SHELL if you want the generated shell to have the
@@ -133,5 +133,5 @@
restricted by being run with the name "rbash", or by setting the -r
flag. */
-#define RESTRICTED_SHELL
+/* #define RESTRICTED_SHELL */
/* Define DISABLED_BUILTINS if you want "builtin foo" to always run the
@@ -143,5 +143,5 @@
/* Right now, you cannot do this on machines without fully operational
FIFO support. This currently include NeXT and Alliant. */
-#if !defined (MKFIFO_MISSING)
+#if !defined (MKFIFO_MISSING) || defined (HAVE_DEV_FD)
# define PROCESS_SUBSTITUTION
#endif /* !MKFIFO_MISSING */
diff -u2r orig/execute_cmd.c ./execute_cmd.c
--- orig/execute_cmd.c Fri Nov 12 16:55:40 1993
+++ ./execute_cmd.c Tue Dec 28 14:07:08 1993
@@ -432,4 +432,7 @@
{
close_pipes (pipe_in, pipe_out);
+#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
+ unlink_fifo_list ();
+#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
/* If we are part of a pipeline, and not the end of the pipeline,
@@ -1428,4 +1431,7 @@
{
close_pipes (pipe_in, pipe_out);
+#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
+ unlink_fifo_list ();
+#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
goto return_result;
}
@@ -1468,4 +1474,7 @@
{
close_pipes (pipe_in, pipe_out);
+#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
+ unlink_fifo_list ();
+#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
result = EXECUTION_SUCCESS;
goto return_result;
@@ -1783,7 +1792,46 @@
}
+ /* Clear any ouput errors from redirected builtins. */
+ clearerr (stdout);
+ clearerr (stderr);
+
return (result);
}
+#if defined (atarist)
+static char *const suffixes[] = { ".ttp", ".tos", ".prg", ".app", ".gtp" };
+
+#define N_SUFFIXES (sizeof (suffixes) / sizeof (suffixes[0]))
+#define MAX_SUFFIX_LEN 4
+
+char *
+find_suffixed_file (name)
+ char *name;
+{
+ char *basename = strrchr (name, '/');
+
+ if (strchr (basename ? basename : name, '.') == NULL)
+ {
+ int i, status, name_len = strlen (name);
+ char *name_suffix = alloca (name_len + MAX_SUFFIX_LEN + 1);
+
+ status = file_status (name);
+ if (status & FS_EXISTS)
+ return savestring (name);
+
+ strcpy (name_suffix, name);
+ for (i = 0; i < N_SUFFIXES; i++)
+ {
+ strcpy (name_suffix + name_len, suffixes[i]);
+ status = file_status (name_suffix);
+
+ if (status & FS_EXECABLE)
+ return savestring (name_suffix);
+ }
+ }
+ return savestring (name);
+}
+#endif
+
/* Execute a simple command that is hopefully defined in a disk file
somewhere.
@@ -1866,5 +1914,9 @@
/* A command containing a slash is not looked up in PATH. */
if (absolute_program (words->word->word))
+#ifdef atarist
+ command = find_suffixed_file (words->word->word);
+#else
command = savestring (words->word->word);
+#endif
else
{
@@ -1955,4 +2007,7 @@
/* Make sure that the pipes are closed in the parent. */
close_pipes (pipe_in, pipe_out);
+#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
+ unlink_fifo_list ();
+#endif /* PROCESS_SUBSTITUTION && HAVE_DEV_FD */
if (command)
free (command);
@@ -2035,4 +2090,12 @@
args[larry] = (char *)NULL;
+#ifdef atarist
+ {
+ char *p = find_suffixed_file (execname);
+ free (execname);
+ execname = p;
+ }
+#endif
+
return (shell_execve (execname, args, env));
}
@@ -3148,5 +3211,9 @@
if (absolute_program (name))
{
+#ifdef atarist
+ full_path = (char *)xmalloc (1 + MAX_SUFFIX_LEN + name_len);
+#else
full_path = (char *)xmalloc (1 + name_len);
+#endif
strcpy (full_path, name);
@@ -3156,4 +3223,21 @@
if (!(status & FS_EXISTS))
{
+#ifdef atarist
+ char *basename = strrchr (name, '/');
+ if (strchr (basename ? basename : name, '.') == NULL)
+ {
+ int i;
+
+ for (i = 1; i < N_SUFFIXES; i++)
+ {
+ strcpy (full_path + name_len, suffixes[i]);
+ status = file_status (full_path);
+
+ if (flags & FS_EXEC_ONLY
+ ? status & FS_EXECABLE : status & FS_EXISTS)
+ return full_path;
+ }
+ }
+#endif
free (full_path);
return ((char *)NULL);
@@ -3203,5 +3287,9 @@
dot_found_in_search = 1;
+#ifdef atarist
+ full_path = make_full_pathname (path, name, name_len + MAX_SUFFIX_LEN);
+#else
full_path = make_full_pathname (path, name, name_len);
+#endif
free (path);
@@ -3209,5 +3297,38 @@
if (!(status & FS_EXISTS))
+#ifndef atarist
goto next_file;
+#else
+ {
+ if (strchr (name, '.') == NULL)
+ {
+ int i, len = strlen (full_path);
+
+ for (i = 0; i < N_SUFFIXES; i++)
+ {
+ strcpy (full_path + len, suffixes[i]);
+ status = file_status (full_path);
+ if (status & FS_EXISTS)
+ {
+ if (flags & FS_EXISTS)
+ return full_path;
+ if (status & FS_EXECABLE)
+ {
+ if (file_to_lose_on)
+ free (file_to_lose_on);
+
+ return full_path;
+ }
+ if (flags & FS_EXEC_PREFERRED)
+ {
+ if (!file_to_lose_on)
+ file_to_lose_on = savestring (full_path);
+ }
+ }
+ }
+ }
+ goto next_file;
+ }
+#endif
/* The file exists. If the caller simply wants the first file,
diff -u2r orig/general.c ./general.c
--- orig/general.c Tue Aug 31 19:53:44 1993
+++ ./general.c Thu Dec 16 19:33:48 1993
@@ -559,4 +559,9 @@
char *result;
+#ifdef atarist
+ if (string[0] && string[1] == ':')
+ return (savestring (string));
+#endif
+
if (!dot_path || *string == '/')
result = savestring (string);
@@ -593,4 +598,9 @@
return (1);
+#ifdef atarist
+ if (string[0] && string[1] == ':')
+ return 1;
+#endif
+
if (*string++ == '.')
{
@@ -650,4 +660,8 @@
if (*file == '/')
return (file);
+#ifdef atarist
+ else if (*file && file[1] == ':')
+ return file;
+#endif
disposer = file;
@@ -688,4 +702,6 @@
}
+#ifndef atarist
+
#if !defined (to_upper)
#define lowercase_p(c) (((c) > ('a' - 1) && (c) < ('z' + 1)))
@@ -733,4 +749,6 @@
return (*string1 | *string2);
}
+
+#endif /* !atarist */
/* Set the environment variables $LINES and $COLUMNS in response to
diff -u2r orig/jobs.c ./jobs.c
--- orig/jobs.c Thu Dec 16 18:18:54 1993
+++ ./jobs.c Thu Dec 16 18:54:18 1993
@@ -190,5 +190,7 @@
/* These are definitions to map POSIX 1003.1 functions onto existing BSD
library functions and system calls. */
+#ifndef atarist
#define setpgid(pid, pgrp) setpgrp (pid, pgrp)
+#endif
#define tcsetpgrp(fd, pgrp) ioctl ((fd), TIOCSPGRP, &(pgrp))
@@ -205,4 +207,5 @@
}
+#ifndef atarist
/* Perform OPERATION on NEWSET, perhaps leaving information in OLDSET. */
sigprocmask (operation, newset, oldset)
@@ -233,4 +236,5 @@
*oldset = old;
}
+#endif /* !atarist */
#endif /* !_POSIX_VERSION */
@@ -1908,5 +1912,5 @@
wait3 ((union wait *)statusp, options, (struct rusage *)0)
#else
-# if defined (_POSIX_VERSION)
+# if defined (_POSIX_VERSION) || defined (atarist)
# define WAITPID(pid, statusp, options) \
waitpid ((pid_t)pid, statusp, options)
@@ -2237,5 +2241,5 @@
/* getpgrp () varies between systems. Even systems that claim to be
Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */
-#if defined (_POSIX_VERSION) && !defined (BSD_GETPGRP)
+#if defined (_POSIX_VERSION) && !defined (BSD_GETPGRP) || defined (atarist)
# define getpgid(p) getpgrp ()
#else
diff -u2r orig/jobs.h ./jobs.h
--- orig/jobs.h Thu Dec 16 18:18:54 1993
+++ ./jobs.h Thu Dec 16 18:55:28 1993
@@ -214,5 +214,5 @@
#endif /* !SIGCHLD */
-#if !defined (_POSIX_VERSION)
+#if !defined (_POSIX_VERSION) && !defined (atarist)
# if !defined (SIG_BLOCK)
# define SIG_BLOCK 2
@@ -251,5 +251,5 @@
sigprocmask (SIG_BLOCK, &nvar, &ovar)
-#if defined (_POSIX_VERSION)
+#if defined (_POSIX_VERSION) || defined (atarist)
# define BLOCK_CHILD(nvar, ovar) \
BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
diff -u2r orig/lib/readline/bind.c ./lib/readline/bind.c
--- orig/lib/readline/bind.c Fri Nov 12 16:55:38 1993
+++ ./lib/readline/bind.c Thu Dec 16 19:34:32 1993
@@ -66,4 +66,5 @@
extern int rl_blink_matching_paren;
extern int _rl_convert_meta_chars_to_ascii;
+extern int _rl_output_meta_chars;
#if defined (VISIBLE_STATS)
extern int rl_visible_stats;
@@ -82,5 +83,7 @@
static int glean_key_from_name ();
+#ifndef atarist
static int stricmp (), strnicmp ();
+#endif
#if defined (STATIC_MALLOC)
@@ -934,4 +937,5 @@
{ "blink-matching-paren", &rl_blink_matching_paren },
{ "convert-meta", &_rl_convert_meta_chars_to_ascii },
+ { "output-meta", &_rl_output_meta_chars },
#if defined (VISIBLE_STATS)
{ "visible-stats", &rl_visible_stats },
@@ -1364,4 +1368,5 @@
}
+#ifndef atarist
/* Whoops, Unix doesn't have strnicmp. */
@@ -1402,4 +1407,6 @@
return (*string1 | *string2);
}
+
+#endif /* !atarist */
/* Determine if s2 occurs in s1. If so, return a pointer to the
diff -u2r orig/lib/readline/complete.c ./lib/readline/complete.c
--- orig/lib/readline/complete.c Thu Dec 16 18:18:46 1993
+++ ./lib/readline/complete.c Sat Jan 29 19:58:14 1994
@@ -137,5 +137,5 @@
/* Local variable states what happened during the last completion attempt. */
-static int completion_changed_buffer = 0;
+static int completion_was_ambigous = 0;
/* Complete the word at or before point. You have supplied the function
@@ -146,5 +146,5 @@
int ignore, invoking_key;
{
- if (rl_last_func == rl_complete && !completion_changed_buffer)
+ if (rl_last_func == rl_complete && completion_was_ambigous)
rl_complete_internal ('?');
else
@@ -277,16 +277,11 @@
Function *our_func;
int start, scan, end, delimiter = 0, pass_next;
- char *text, *saved_line_buffer;
+ char *text;
char *replacement;
-#if defined (SHELL)
char quote_char = '\0';
+#if defined (SHELL)
int found_quote = 0;
#endif
- if (rl_line_buffer)
- saved_line_buffer = savestring (rl_line_buffer);
- else
- saved_line_buffer = (char *)NULL;
-
if (rl_completion_entry_function)
our_func = rl_completion_entry_function;
@@ -468,21 +463,16 @@
Copy all the non-dead entries into a new array. */
{
- char **temp_array =
- (char **)xmalloc ((3 + newlen) * sizeof (char *));
-
for (i = 1, j = 1; matches[i]; i++)
{
if (matches[i] != (char *)&dead_slot)
- temp_array[j++] = matches[i];
+ matches[j++] = matches[i];
}
- temp_array[j] = (char *)NULL;
+ matches[j] = (char *)NULL;
if (matches[0] != (char *)&dead_slot)
free (matches[0]);
- free (matches);
-
- matches = temp_array;
+ matches = realloc (matches, (j + 1) * sizeof (char *));
}
@@ -578,4 +568,5 @@
}
+ rl_begin_undo_group ();
if (replacement)
{
@@ -630,4 +621,5 @@
}
}
+ rl_end_undo_group ();
break;
@@ -636,7 +628,7 @@
int i = 1;
+ rl_begin_undo_group ();
rl_delete_text (start, rl_point);
rl_point = start;
- rl_begin_undo_group ();
if (matches[1])
{
@@ -823,18 +815,9 @@
}
+ completion_was_ambigous = matches[1] != NULL;
+
for (i = 0; matches[i]; i++)
free (matches[i]);
free (matches);
- }
-
- /* Check to see if the line has changed through all of this manipulation. */
- if (saved_line_buffer)
- {
- if (strcmp (rl_line_buffer, saved_line_buffer) != 0)
- completion_changed_buffer = 1;
- else
- completion_changed_buffer = 0;
-
- free (saved_line_buffer);
}
}
diff -u2r orig/lib/readline/display.c ./lib/readline/display.c
--- orig/lib/readline/display.c Wed Sep 1 22:25:04 1993
+++ ./lib/readline/display.c Sat Nov 20 18:37:40 1993
@@ -59,5 +59,5 @@
extern void _rl_output_character_function ();
-extern int _rl_convert_meta_chars_to_ascii;
+extern int _rl_output_meta_chars;
extern int _rl_horizontal_scroll_mode;
extern int _rl_mark_modified_lines;
@@ -219,5 +219,5 @@
if (META_CHAR (c))
{
- if (_rl_convert_meta_chars_to_ascii)
+ if (!_rl_output_meta_chars)
{
sprintf (line + out, "\\%o", c);
@@ -602,5 +602,5 @@
int c;
{
- if (META_CHAR (c) && _rl_convert_meta_chars_to_ascii)
+ if (META_CHAR (c) && !_rl_output_meta_chars)
{
fprintf (rl_outstream, "M-");
@@ -626,5 +626,5 @@
{
if (META_CHAR (c))
- return (_rl_convert_meta_chars_to_ascii ? 4 : 1);
+ return (!_rl_output_meta_chars ? 4 : 1);
if (c == '\t')
diff -u2r orig/lib/readline/isearch.c ./lib/readline/isearch.c
--- orig/lib/readline/isearch.c Tue Aug 31 19:53:50 1993
+++ ./lib/readline/isearch.c Sat Nov 20 14:32:30 1993
@@ -323,4 +323,7 @@
ding ();
i = last_found_line;
+ index = rl_point;
+ if (c >= 32 && c <= 126)
+ search_string[--search_string_index] = '\0';
break;
diff -u2r orig/lib/readline/readline.c ./lib/readline/readline.c
--- orig/lib/readline/readline.c Fri Nov 12 16:55:52 1993
+++ ./lib/readline/readline.c Sat Nov 20 18:33:18 1993
@@ -236,4 +236,8 @@
int _rl_convert_meta_chars_to_ascii = 1;
+/* Non-zero means to output characters with the meta bit set directly
+ instead of as escape sequence. */
+int _rl_output_meta_chars = 0;
+
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
the undo list. */
@@ -517,6 +521,8 @@
fcntl (tty, F_SETFL, flags);
+#ifndef atarist
if (chars_avail == -1 && errno == EAGAIN)
return;
+#endif
}
#endif /* O_NDELAY */
@@ -1544,5 +1550,5 @@
{
/* If possible and desirable, concatenate the undos. */
- if ((strlen (string) == 1) &&
+ if (l == 1 &&
rl_undo_list &&
(rl_undo_list->what == UNDO_INSERT) &&
@@ -1626,20 +1632,22 @@
if (count < 0)
rl_backward (-count);
- else
- while (count)
- {
+ else if (count > 0)
+ {
#if defined (VI_MODE)
- if (rl_point >= (rl_end - (rl_editing_mode == vi_mode)))
+ if (rl_point + count > (rl_end - (rl_editing_mode == vi_mode)))
#else
- if (rl_point == rl_end)
+ if (rl_point + count > rl_end)
#endif /* VI_MODE */
- {
- ding ();
- return 0;
- }
- else
- rl_point++;
- --count;
- }
+ {
+#if defined (VI_MODE)
+ rl_point = (rl_end - (rl_editing_mode == vi_mode));
+#else
+ rl_point = rl_end;
+#endif /* VI_MODE */
+ ding ();
+ }
+ else
+ rl_point += count;
+ }
return 0;
}
@@ -1651,16 +1659,14 @@
if (count < 0)
rl_forward (-count);
- else
- while (count)
- {
- if (!rl_point)
- {
- ding ();
- return 0;
- }
- else
- --rl_point;
- --count;
- }
+ else if (count > 0)
+ {
+ if (rl_point < count)
+ {
+ rl_point = 0;
+ ding ();
+ }
+ else
+ rl_point -= count;
+ }
return 0;
}
@@ -2116,5 +2122,5 @@
rl_point--;
- rl_kill_text (rl_point, orig_point);
+ rl_kill_text (orig_point, rl_point);
}
return 0;
diff -u2r orig/machines.h ./machines.h
--- orig/machines.h Thu Dec 16 18:18:58 1993
+++ ./machines.h Thu Dec 30 14:45:12 1993
@@ -1630,4 +1630,29 @@
#endif /* cadmus */
+/* ************************ */
+/* */
+/* Atari ST */
+/* */
+/* ************************ */
+#if defined (atarist)
+#define M_MACHINE "atarist"
+#define M_OS "MiNT"
+#define HAVE_POSIX_SIGNALS
+#define HAVE_VFPRINTF
+#define HAVE_SETLINEBUF
+#define HAVE_STRCHR
+#define HAVE_STRERROR
+#define HAVE_GETGROUPS
+#define HAVE_DUP2
+#define HAVE_GETPAGESIZE
+#define HAVE_GETDTABLESIZE
+#define HAVE_GETWD
+#define HAVE_SYS_SIGLIST
+#define SYSDEP_CFLAGS -DHAVE_BCOPY -DHAVE_UID_T -DMKFIFO_MISSING
+#undef USE_GNU_MALLOC
+#define HAVE_DIRENT
+#define VOID_SIGHANDLER
+#endif
+
/* **************************************************************** */
/* */
diff -u2r orig/maxpath.h ./maxpath.h
--- orig/maxpath.h Fri Nov 12 16:54:58 1993
+++ ./maxpath.h Sat Nov 20 13:46:08 1993
@@ -11,5 +11,5 @@
#if !defined (MAXPATHLEN)
-# if defined (bsdi) || defined (OSF1) || defined (Solaris) || defined (Dynix)
+# if defined (bsdi) || defined (OSF1) || defined (Solaris) || defined (Dynix) || defined (atarist)
# include <sys/param.h>
# endif /* bsdi || OSF1 || Solaris || Dynix */
diff -u2r orig/nojobs.c ./nojobs.c
--- orig/nojobs.c Thu Dec 16 18:19:08 1993
+++ ./nojobs.c Thu Dec 16 19:01:42 1993
@@ -57,9 +57,9 @@
#endif /* USG || _POSIX_VERSION */
-#if defined (USG)
+#if defined (USG) || defined (atarist)
# define siginterrupt(sig, code)
#endif /* USG */
-#if defined (_POSIX_VERSION)
+#if defined (_POSIX_VERSION) || defined (atarist)
# define WAITPID(pid, statusp, options) waitpid (pid, statusp, options)
#else
diff -u2r orig/parse.y ./parse.y
--- orig/parse.y Thu Dec 16 18:19:10 1993
+++ ./parse.y Sun Feb 20 16:03:26 1994
@@ -50,5 +50,4 @@
#endif /* PROMPT_STRING_DECODE */
-#define YYDEBUG 1
extern int eof_encountered;
extern int no_line_editing;
@@ -2069,5 +2068,7 @@
{
#if defined (PROCESS_SUBSTITUTION)
- if (character == '$' || character == '<' || character == '>')
+ if (character == '$'
+ || ((character == '<' || character == '>')
+ && current_delimiter () != '"'))
#else
if (character == '$')
@@ -2490,5 +2491,5 @@
register int i;
- chars_to_add = (char *)NULL;
+ chars_to_add = "; ";
for (i = 0; no_semi_successors[i]; i++)
@@ -2500,6 +2501,4 @@
}
}
- if (!chars_to_add)
- chars_to_add = "; ";
}
else
diff -u2r orig/shell.c ./shell.c
--- orig/shell.c Thu Dec 16 18:19:14 1993
+++ ./shell.c Sun Feb 20 16:05:18 1994
@@ -360,6 +360,4 @@
}
- yydebug = 0;
-
shell_environment = env;
shell_name = argv[0];
@@ -529,5 +527,7 @@
}
+#ifndef atarist
#define CLOSE_FDS_AT_LOGIN
+#endif
#if defined (CLOSE_FDS_AT_LOGIN)
@@ -1021,4 +1021,10 @@
history_lines_this_session = 0;
}
+ else
+ {
+ result = write_history (hf);
+ history_lines_in_file = history_lines_this_session;
+ history_lines_this_session = 0;
+ }
}
}
@@ -1944,7 +1950,9 @@
}
+#ifndef atarist
#if !defined (USG) && defined (ENOTSOCK)
#include <sys/socket.h>
#endif
+#endif
/* Is FD a socket or network connection? */
@@ -1953,4 +1961,7 @@
int fd;
{
+#ifdef atarist
+ return 0;
+#else
#if defined (USGr4) || defined (USGr4_2)
/* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */
@@ -1983,3 +1994,4 @@
# endif /* !ENOTSOCK && !USG */
#endif /* !USGr4 && !USGr4_2 */
+#endif /* !atarist */
}
diff -u2r orig/subst.c ./subst.c
--- orig/subst.c Thu Dec 16 18:19:20 1993
+++ ./subst.c Sun Feb 20 16:06:22 1994
@@ -1769,4 +1769,9 @@
pid_t old_pipeline_pgrp = pipeline_pgrp;
pipeline_pgrp = shell_pgrp;
+#ifdef atarist
+ /* Avoid race condition. Since fork () is blocking, we don't have
+ the chance to set the SIGCHLD handler before the child dies. */
+ set_sigchld_handler ();
+#endif
pid = make_child (savestring ("process substitution"), 1);
if (pid == 0)
@@ -1897,4 +1902,9 @@
pipeline_pgrp = shell_pgrp;
+#ifdef atarist
+ /* Avoid race condition. Since fork () is blocking, we don't have
+ the chance to set the SIGCHLD handler before the child dies. */
+ set_sigchld_handler ();
+#endif
pid = make_child (savestring ("command substitution"), 0);
if (pid == 0)
@@ -2436,4 +2446,7 @@
char *temp1;
int old_index;
+
+ if (quoted)
+ goto add_character;
if (string[++sindex] != '(')
diff -u2r orig/trap.c ./trap.c
--- orig/trap.c Fri Nov 12 16:56:02 1993
+++ ./trap.c Sat Nov 20 14:44:54 1993
@@ -111,5 +111,5 @@
int signal;
{
- if (signal > NSIG)
+ if (signal >= NSIG)
return ("bad signal number");
else